package com.winit.openapi.util;


/**
 * URI校验工具类
 * @author kang.wang 2015-1-8 下午1:25:46
 * @since 1.0
 */
public class EscapeURL {
    
    public static final String[] escapeURL = {"service","success","api_adapted_success","api_adapted_error","error","api","getToken","getTracking",
    	"countryList","getRegionList","getCityList","register","API","isActivationCustomer",
    	"supplementUsCustomer","activeCustomer","district","city","province","validateLoginName",
    	"getDistrictList","modifyPassword","createISPOrderAscan","createISPOrderAscanWarehouse","activeModifyUserName","existCustomerByCode","reservationOrderList",
    	"reservationOrderDetail","waitingReservationList","editReservationOrder","createReservationOrder","printReservationOrder",
    	"queryWarehouseByCode","applyForChangePassword","modifyUserPasswordByVerificationCode","registerDistributor",
    	"registerFinanceUser","getFinanceUserToken","sendVerificationCode","checkAccountIsExist","checkVerificationCode","forgetPassword",
    	"loginForFinanceUser","KuaiDi100Callback","bpepNotice","payoneerPayIpcn","confirmRechargeSuccess","createIpnMessage","mailRegister","updateClickAccout","queryPromoteUrl","addPotentialCustomer","saveTemporarily","newUserRegister","queryRegisterTemporary","checkIdentityCardUnique","allCountry",
    	//加入3E白名单
    	"checkCetificate", "getCetificate","updateInboundPredarrFWhDate","updateForecastWHTime","queryWarehouseByType","conversionConfig","allCountry","calculateFee","fuzzyQueryCustomerByName","checkCustomerCode","existsRecommendUser",
    	"checkCustomerNameUnique","verification"
    	};
    
    public static boolean check(String url){
        //oauth2.0认证的请求不需要签名
//        if(url.contains("oauth")){
//            return true;
//        }
        String uri = url.substring(url.lastIndexOf("/")+1);
        for(String s:escapeURL){
            if(s.equals(uri)){
                return true;
            }
        }
        return false;
    }

}
